
var objOrder = null;
var iCurrOrder = 0;
var flagOrderInfo = 0;
var Global_objOrderInfo;

document.observe("dom:loaded", loadMainMyVoucher);
function loadMainMyVoucher() {

    if ($("tableOrder")) {
        $('tableOrder').select('a').each(function(atr) {
            $(atr).observe('click', function(e) { showPopupStatusOrder($(atr).id); });
        });
    }

//    if ($("dvChiTienDonHangShadow")) {
//        window.onresize = function(event) {
//            $("dvChiTienDonHangShadow").setStyle({ width: (document.documentElement.scrollWidth <= 986) ? "986px" : "100%"});
//        }
//    } 
}
function showPopupStatusOrder(e) {
    if (strOrder == "0") { return; }

    objOrder = strOrder;
    flagOrderInfo = 0;
    var i = parseInt(e.split('_')[1]); iCurrOrder = i;
        
    $("lblFullName").innerHTML = objOrder.dsOrder[i].HoTen;
    //$("lblStreet").innerHTML = "";
    $("lblDiaChi").innerHTML = objOrder.dsOrder[i].DiaChi;
    $("lblPhone").innerHTML = objOrder.dsOrder[i].DienThoai;
    $("lblMaOrder").innerHTML = objOrder.dsOrder[i].MaHD;
    $("lblOrderDate").innerHTML = objOrder.dsOrder[i].NgayMua;
    if (objOrder.dsOrder[i].TrangThai == "0") {
        $("lblOrderStatus").innerHTML = langOrderInfo()[0][0];
    }
    else if (objOrder.dsOrder[i].TrangThai == "1") {
        $("lblOrderStatus").innerHTML = langOrderInfo()[0][1];
    }
    else if (objOrder.dsOrder[i].TrangThai == "2") {
        $("lblOrderStatus").innerHTML = langOrderInfo()[0][2];
    }
    else if (objOrder.dsOrder[i].TrangThai == "3") {
        $("lblOrderStatus").innerHTML = langOrderInfo()[0][3];
    }
    else if (objOrder.dsOrder[i].TrangThai == "4") {
        $("lblOrderStatus").innerHTML = langOrderInfo()[0][4];
    }
    $("lblIDSP").innerHTML = objOrder.dsOrder[i].MaHang;
    $("lblTenSP").innerHTML = objOrder.dsOrder[i].TenHang;

    if (objOrder.dsOrder[i].payoo != "True" && strNokiaC7.toString().indexOf("," + objOrder.dsOrder[i].MaHang + ",") == -1 && objOrder.dsOrder[i].TrangThai == "1") 
    {
        var strHTMLSL;
        strHTMLSL = '<div style="margin:0px 0 0 4px;float:none" class="div_txtDayDK monthDK"><select autocomplete="off" id="ddlSL_0" style="font-size:15px;width:50px;" name="ddlSL_Order" class="ddlDWBirth">';
        for (var j = 0; j < parseInt(objOrder.dsOrder[i].SLMua); j++) 
        {
            strHTMLSL += '<option ' + (objOrder.dsOrder[i].SoLuong == (j + 1) ? "selected='selected'" : "") + ' value="' + (j + 1) + '" >' + (j + 1) + '</option>';
        }
        strHTMLSL += '</select></div>';
        
        $("lblSL").innerHTML = strHTMLSL
    } 
    else {
        $("lblSL").innerHTML = objOrder.dsOrder[i].SoLuong;
    }
    if ($("ddlSL_0")) {
        $('ddlSL_0').onchange = onChangePricePopUp_DDL_MyVoucher;
    }
    var strHTML = "";
    if (objOrder.dsOrder[i].isTravel == "True") {
        Global_objOrderInfo = objOrder.dsOrder[i];

        strHTML += '<h4 onclick="ShowVoucherCode()">' + langOrderInfo()[0][33] + '</h4>';
        strHTML += '<div style="width:305px;margin:10px 0 0px 0px;float:left;position:relative;overflow:hidden;height:0px;display:none" id="dVoucherCode">' +
    						    '<div id="dVoucherHeight">' +
                                    '<div style="width:300px;border-left:1px solid #999999;border-right:1px solid #999999;border-top:1px solid #999999">' +
                                        '<table cellspacing="0" cellpadding="0" border="0" class="tableOrderPU" style="position:relative;margin-top:-3px;width:300px;;border-bottom:1px solid #999999">' +
  							                '<tbody>' +
  							                '<tr class="trfirst">' +
  							                 '<th class="thMaHang"   valign="top" align="center">STT</th>' +
    						                 '<th class="th_TongCong"  valign="top" align="center">' + langOrderInfo()[0][34] + '</th>' +
  							                '</tr>';
        for (var j = 0; j < (objOrder.dsOrder[i].SoLuong > 10 ? 10 : objOrder.dsOrder[i].SoLuong); j++) {
            strHTML += '<tr>';
            if (parseInt(objOrder.dsOrder[i].MaHang) > 375) {
                strHTML += '<th class="thMaHang"   valign="top" align="center"  style="padding:5px 0px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + (j + 1) + '</th>';
                strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 0px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + objOrder.dsOrder[i].MaHD + "-" + (j + 1) + '</th>';
            }
            else {
                strHTML += '<th class="thMaHang"   valign="top" align="center"  style="padding:5px 10px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + (j + 1) + '</th>';
                if (j <= 25)
                    strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 10px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + objOrder.dsOrder[i].MaHD + " - " + (String.fromCharCode(j + 97).toUpperCase()) + '</th>';
                else
                    strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 10px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + objOrder.dsOrder[i].MaHD + " - " + (String.fromCharCode(97).toUpperCase()) + (j - 25) + '</th>';
            }
            strHTML += '</tr>';
        }
        strHTML += '</tbody></table></div>';

        if (parseInt(objOrder.dsOrder[i].SoLuong) > 10) {
            var TotalPage = parseInt(objOrder.dsOrder[i].SoLuong) / 10;
            if ((parseInt(objOrder.dsOrder[i].SoLuong) % 10) > 0) TotalPage++;
            strHTML += '<div class="dPageLinkMap" style="width:100%; height: auto; position: relative;">';
            strHTML += '<span>1</span>';
            for (var j = 2; j <= TotalPage; j++) {
                strHTML += '<a onclick="innerVoucherCode(' + j + ');" href="javascript:void(0);">' + j + '</a>';
            }
            strHTML += '</div>';
        }
        strHTML += '</div></div>';
    }
    $("dvXemMaVoucher").innerHTML = strHTML;

    if (objOrder.dsOrder[i].TrangThai == "1" && objOrder.dsOrder[i].payoo != "True" && strNokiaC7.toString().indexOf("," + objOrder.dsOrder[i].MaHang + ",") == -1) {
        $('aHuy').onclick = cancelStatusOrder;
        $('aChapNhan').onclick = updateStatusOrder;

        $('eChuY').style.display = 'block';
        $('aHuy').style.display = 'block';
        $('aChapNhan').style.display = 'block';
    } else {
        $('aHuy').onclick = "";
        $('aChapNhan').onclick = "";

        $('eChuY').style.display = 'none';
        $('aHuy').style.display = 'none';
        $('aChapNhan').style.display = 'none';
    }
    
    $("lblPrice").innerHTML = objOrder.dsOrder[i].GiaTien;
    $("lblTotal").innerHTML = objOrder.dsOrder[i].TongCong;
    
    var h = document.documentElement.scrollHeight.toString();
//    var w = document.documentElement.scrollWidth.toString();
//    var l = (w - $("popupMyVoucher").getWidth()) / 2;
    $("dvChiTienDonHangShadow").setStyle({ width: "100%", height: h.toString() + "px", display: "block" });
    $("popupMyVoucher").setStyle({ width: "100%", margin: "auto", top: "50px" });
    $("dvChiTienDonHang").setStyle({margin: "auto", left: "auto" });
    
    
    top.window.scroll(0, 0);
    $("popupMyVoucher").removeClassName("hide");
    $("btnClose").onclick = hidePopupStatusOrder;
    var strUrlLocation = window.location.href;
    strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', ''); 
    if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
        strUrlLink = strPathLink_All + "yahoo/";
    }
    var city = GetCookie("stateCity");
    
    utils.call(strUrlLink + city + "/profile/myvoucher.aspx", { "flag": "getCom", "IDOrder": objOrder.dsOrder[i].SoHD, "CountPage": "5", "CurrentPage": "1" }, "POST", "showCommentOrder", "showCommentOrder");
}

function ShowVoucherCode() {
    if ($("dVoucherCode").offsetHeight == 0) {
        $("dVoucherCode").style.display = "block";
        Show();
    }
    else
        Hide();
}
function Show() {
    var curHeight = parseInt($("dVoucherCode").offsetHeight);
    var VoucherHeight = parseInt($("dVoucherHeight").offsetHeight);
    if (curHeight < VoucherHeight) {
        $("dVoucherCode").style.height = ((curHeight + 20) > VoucherHeight ? VoucherHeight : (curHeight + 20)) + "px";
        t1 = setTimeout("Show()", 20);
    } else {
        clearTimeout(t1);
    }
}
function Hide() {
    var curHeight = parseInt($("dVoucherCode").offsetHeight);
    if (curHeight > 0) {
        $("dVoucherCode").style.height = ((curHeight - 20) < 0 ? 0 : (curHeight - 20)) + "px";
        t2 = setTimeout("Hide()", 20);
    } else {
        $("dVoucherCode").style.display = "none";
        clearTimeout(t2);
    }
}
function innerVoucherCode(Page) {
    var objOrderInfo = Global_objOrderInfo;
    var code = "";
    var strHTML =   '<div style="width:300px;border-left:1px solid #999999;border-right:1px solid #999999;border-top:1px solid #999999;border-bottom:1px solid #999999">' +
                        '<table cellspacing="0" cellpadding="0" border="0" class="tableOrderPU" style="position:relative;margin-top:-3px;width:300px;">' +
	                        '<tbody>' +
	                            '<tr class="trfirst">' +
	                                '<th class="thMaHang"   valign="top" align="center">STT</th>' +
	                                '<th class="th_TongCong"  valign="top" align="center">Mã voucher</th>' +
	                            '</tr>';
    for (var i = (Page * 10) - 10; i < (objOrderInfo.SoLuong > (Page * 10) ? (Page * 10) : objOrderInfo.SoLuong); i++) {
        strHTML += '<tr>';
        if (parseInt(objOrderInfo.MaHang) > 375) {
            strHTML += '<th class="thMaHang"  valign="top" align="center"  style="padding:5px 0px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + (i + 1) + '</th>';
            strHTML += '<th class="th_TongCong" valign="top" align="left" style="padding:5px 0px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + objOrderInfo.MaHD + "-" + (i + 1) + '</th>';
        }
        else {
            strHTML += '<th class="thMaHang"   valign="top" align="center"  style="padding:5px 10px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + (i + 1) + '</th>';
            if (i > 25) code = parseInt(i / 26);
            strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 10px; border: solid 1px #C3C3C3; background-color: #E7EFF4; color: #3D3D3D;">' + objOrderInfo.MaHD + " - " + (String.fromCharCode(i % 26 + 97).toUpperCase()) + code + '</th>';
        }
        strHTML += '</tr>';
    }
    strHTML += '</tbody></table></div>';

    if (parseInt(objOrderInfo.SoLuong) > 10) {
        var TotalPage = parseInt(objOrderInfo.SoLuong) / 10;
        if ((parseInt(objOrderInfo.SoLuong) % 10) > 0) TotalPage++;
        strHTML += '<div class="dPageLinkMap" style="width:100%; height: auto; position: relative;">';
        for (var j = 1; j <= TotalPage; j++) { 
            strHTML += (j != Page) ? '<a onclick="innerVoucherCode(' + j + ');" href="javascript:void(0);">' + j + '</a>' : '<span>' + j + '</span>';
        }
        strHTML += '</div>';
    }
    $("dVoucherHeight").innerHTML = strHTML;
}
function onChangePricePopUp_DDL_MyVoucher(e) {
    var eID = utils.getElementFireEvent(e);
    var strValue = eID.value;
    if (flagOrderInfo == 1) {
        if (parseInt(strValue) > parseInt(strOrderInfo.SLMua)) strValue = strOrderInfo.SLMua;
        else if (parseInt(strValue) < 0) strValue = 1;
        var iTotal = ConvertToMoney(parseInt(strValue) * parseInt(strOrderInfo.GiaBan));
        var iMoney = parseInt(strOrderInfo.iMyMoney);
        if (iMoney + parseInt(iTotalMoney) > 0 && iMoney + parseInt(iTotalMoney) >= (parseInt(strValue) * parseInt(strOrderInfo.GiaBan))) {
            $("lblTotal").innerHTML = 0;
        }
        else if (iMoney + parseInt(iTotalMoney) > 0 && iMoney + parseInt(iTotalMoney) < parseInt(strValue) * parseInt(strOrderInfo.GiaBan)) {
            $("lblTotal").innerHTML = ConvertToMoney(parseInt(strValue) * parseInt(strOrderInfo.GiaBan) - (iMoney + parseInt(iTotalMoney)));
        }
        else {
            $("lblTotal").innerHTML = ConvertToMoney(parseInt(strValue) * parseInt(strOrderInfo.GiaBan));
        }
    } else {
        if (parseInt(strValue) > parseInt(objOrder.dsOrder[iCurrOrder].SLMua)) strValue = objOrder.dsOrder[iCurrOrder].SLMua;
        else if (parseInt(strValue) < 0) strValue = 1;
        var iTotal = ConvertToMoney(parseInt(strValue) * parseInt(objOrder.dsOrder[iCurrOrder].GiaBan));
        var iMoney = parseInt(objOrder.dsOrder[iCurrOrder].iMyMoney);
        if (iMoney + parseInt(iTotalMoney) > 0 && iMoney + parseInt(iTotalMoney) >= (parseInt(strValue) * parseInt(objOrder.dsOrder[iCurrOrder].GiaBan))) {
            $("lblTotal").innerHTML = 0;
        }
        else if (iMoney + parseInt(iTotalMoney) > 0 && iMoney + parseInt(iTotalMoney) < parseInt(strValue) * parseInt(objOrder.dsOrder[iCurrOrder].GiaBan)) {
            $("lblTotal").innerHTML = ConvertToMoney(parseInt(strValue) * parseInt(objOrder.dsOrder[iCurrOrder].GiaBan) - (iMoney + parseInt(iTotalMoney)));
        }
        else {
            $("lblTotal").innerHTML = ConvertToMoney(parseInt(strValue) * parseInt(objOrder.dsOrder[iCurrOrder].GiaBan));
        }
    }
    //$('str_' + eID.id).innerHTML = strValue;
};

function updateStatusOrder() {
    var iSoLuong = 0;
    var idOrder = 0;
    if (flagOrderInfo == 1) {
        if ($("ddlSL_0").value == strOrderInfo.SoLuong) { return; }
        iSoLuong = parseInt($("ddlSL_0").value) > parseInt(strOrderInfo.SLMua) ? strOrderInfo.SLMua : parseInt($("ddlSL_0").value);
        idOrder = strOrderInfo.SoHD;
    } else {
        if ($("ddlSL_0").value == objOrder.dsOrder[iCurrOrder].SoLuong) { return; }
        iSoLuong = parseInt($("ddlSL_0").value) > parseInt(objOrder.dsOrder[iCurrOrder].SLMua) ? objOrder.dsOrder[iCurrOrder].SLMua : parseInt($("ddlSL_0").value);
        idOrder = objOrder.dsOrder[iCurrOrder].SoHD;
    }
    var strUrlLocation = window.location.href;
    strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', ''); 
    if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
        strUrlLink = strPathLink_All + "yahoo/";
    }
    var city = GetCookie("stateCity");
    
    utils.call(strUrlLink + city + "/profile/myvoucher.aspx", { "flag": "update", "id": idOrder, "soluong": iSoLuong }, "POST", "resultUpdateStatusOrder", "resultUpdateStatusOrder");
}
function resultUpdateStatusOrder(result) {
    if (parseInt(result) == 0) {
        $("eMsg").innerHTML = (langOrderInfo()[0][28]);
    } else if (parseInt(result) == 2) {
        $("eMsg").innerHTML = (langOrderInfo()[0][27]);
    } else if (parseInt(result) == 3) {
        setTimeout("refesh();", "1000");
    }
    else if (parseInt(result) == 1) {
        $("eMsg").innerHTML = (langOrderInfo()[0][29]);
        setTimeout("refesh();", "1000");
    }
}
function cancelStatusOrder() {
    var answer = confirm(langOrderInfo()[0][26]);
    var idOrder = 0;
    if (answer) {
        idOrder = (flagOrderInfo == 1) ? strOrderInfo.SoHD : objOrder.dsOrder[iCurrOrder].SoHD;
        var strUrlLocation = window.location.href;
        strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
        var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', ''); 
        if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
            strUrlLink = strPathLink_All + "yahoo/";
        }
        var city = GetCookie("stateCity");

        utils.call(strUrlLink + city + "/profile/myvoucher.aspx", { "flag": "cancel", "id": idOrder }, "POST", "resultCancelStatusOrder", "resultCancelStatusOrder");
    }
}
function resultCancelStatusOrder(result) {
    if (parseInt(result) == 0) {
        $("eMsg").innerHTML = (langOrderInfo()[0][27]);
    } else if (parseInt(result) > 0) {
        $("eMsg").innerHTML = (langOrderInfo()[0][29]);
        setTimeout("refesh();", "1000");
    }
}
function refesh() {
    window.location.href = window.location.href;
    return false;
}
function showCommentOrder(obj) { 
    var strHTML = "";
    if (objOrder.dsOrder[iCurrOrder].TrangThai == "1") {
        strHTML += "<div class='comment-content-alignright'>  " +
                    "<textarea class='textareaCP' style='width:691px' id='txtOrderComment'></textarea>" +
                    "<p><a class='view-button-big' name='' id='aSendComment' href='javascript:void(0);' onclick='javascript:insertNewOrderComment();'></a></p>" +
                   " <div class='clear'></div>" +
               " </div>";
    }
    if (obj == "0") { $("dvCommentList").innerHTML = strHTML; return; }
    else {
        for (var i = 0; i < obj.dsComOrder.length - 1; i++) {
            strHTML += "<div class='comment-content'>" +
                            "<div class='detail-deal'>" +
                                "<p>" + obj.dsComOrder[i].Comment + "</p>" +
                                "<p class='user-info'>" +
                                "<a href='javascript:void(0);' name='' style='color: #6A6A6A;'><strong style='color: #0F5F92;'>" + obj.dsComOrder[i].nickname + "</strong>. " + obj.dsComOrder[i].statusname + "</a> - " + obj.dsComOrder[i].UpdateDatetime + "</p>" +
                            "</div>" +
                            "<i></i>" +
                            "<div class='comment-content-right'>" +
                                "<img src='" + obj.dsComOrder[i].logo + "' width='51px' height='51px'/>" +
                            "</div>" +
                            "<div class='clear'></div>" +
                        "</div>";
        }
        var iCM = obj.dsComOrder.length - 1;
        var iTotalPage = parseInt(obj.dsComOrder[iCM].total);
        var CurrentPage = parseInt(obj.dsComOrder[iCM].CurrentPage);
        if (parseInt(obj.dsComOrder[iCM].total) < 2) { $("dvCommentList").innerHTML = strHTML; return; }
        var strPage = "<div class='bg-paging-comment'><div class='paging-comment'>";
        if (parseInt(obj.dsComOrder[iCM].CurrentPage) > 1) { strPage += '<a href="javascript:void(0)" id="aPageCM_' + (parseInt(obj.dsComOrder[iCM].CurrentPage) - 1 <= 1 ? 1 : parseInt(obj.dsComOrder[iCM].CurrentPage) - 1) + '" class="btn-paging" onclick="getCommentByPage(this)">&laquo;Previous</a>'; }
        var iStart = 0;  var iEnd = 0;
        iStart = CurrentPage - 5;
        iStart = iStart <= 1 ? 1 : iStart;
        iEnd = iStart + 9 >= iTotalPage ? iTotalPage : iStart + 9;
        for (var i = iStart; i <= iEnd; i++) {
            strPage += (i == CurrentPage) ? '<span>' + i + '</span>' : '<a href="javascript:void(0)" id="aPageCM_' + i + '" onclick="getCommentByPage(this)">' + i + '</a>';
        }
        strPage += (parseInt(obj.dsComOrder[iCM].CurrentPage) < iTotalPage) ? '<a href="javascript:void(0)" id="aPageCM_' + (parseInt(obj.dsComOrder[iCM].CurrentPage) + 1 >= iTotalPage ? iTotalPage : parseInt(obj.dsComOrder[iCM].CurrentPage) + 1) + '" class="btn-paging" onclick="getCommentByPage(this)">Next&raquo;</a></div></div>' : "</div></div>";
        
        $("dvCommentList").innerHTML = strHTML + strPage;
    }
}
function insertNewOrderComment() {
    if (utils.trim($('txtOrderComment').value).length == 0) {
        alert(langMess()[0][5]);
        return;
    }
    if (utils.trim($('txtOrderComment').value).length > 500) {
        alert(langMess()[0][9]);
        return;
    }
    if ($("txtOrderComment") && utils.trim($('txtOrderComment').value) != "") {
        var comment = $("txtOrderComment").value;
        var strUrlLocation = window.location.href;
        strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
        var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', ''); 
        if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
            strUrlLink = strPathLink_All + "yahoo/";
        }
        var city = GetCookie("stateCity");
        
        utils.call(strUrlLink + city + "/profile/myvoucher.aspx", { "flag": "insert", "IDOrder": (flagOrderInfo == 0 ? objOrder.dsOrder[iCurrOrder].SoHD : strOrderInfo.SoHD), "Comment": comment }, "POST", "showCommentOrder", "showCommentOrder");
        $("aSendComment").onclick = "";
    }
}
function getCommentByPage(e) {
    var iCurrPage = e.id.split('_')[1];
    var strUrlLocation = window.location.href;
    strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', ''); 
    if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
        strUrlLink = strPathLink_All + "yahoo/";
    }
    var city = GetCookie("stateCity");
    utils.call(strUrlLink + city + "/profile/myvoucher.aspx", { "flag": "getCom", "IDOrder": objOrder.dsOrder[iCurrOrder].SoHD, "CountPage": "5", "CurrentPage": iCurrPage }, "POST", "showCommentOrder", "showCommentOrder");
}
function hidePopupStatusOrder(){
    $("popupMyVoucher").addClassName("hide")
    $("dvChiTienDonHangShadow").setStyle({display: "none" });
}